﻿<html>
<head><title>.:: VNews - Tin tức tận tay ::.</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="jquery/jquery-1.8.1.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="UTF-8" />
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta names="apple-mobile-web-app-status-bar-style" content="black-translucent" />
	<script language="javascript">
		jQuery.ajax({
				url:"http://buminta.pro/Vnews/service/login.php",
				xhrFields: {
				withCredentials: true
				},
				success: function (data){
					console.log(data);
					var user_info = JSON.parse(data);
					console.log(user_info);
					if(user_info==''||user_info.result.status!=true){
						alert('Bạn chưa đăng nhập');
						$(window.location).attr('href', 'login.htm');
					}
				}
			});
		$(document).ready(function() {
			jQuery.ajax({
				url: "http://buminta.pro/Vnews/data/RSS.xml",
					success: function(xml) {
					console.log(xml);
					$(xml).find('item').each(function(){
						var title = $(this).find('title').text();
						var url = $(this).find('link').text();
						if (url==null){
							url='images/img-default.png'
						}
						console.log(url);
						var id = $(this).find('iD').text();
						$('#center').append('<div class="bt"><div class="news-img"><img src="'+url+'"></div><div class="news-title">'+title+'</div><input type="image" src="images/view.png"  class="bt-view" onClick="load(\''+id+'\')"></div>');
					})
				}
			});
		})
	</script>
	<div id="footer">
		<input type="image" src="images/backBtn.png" class="backBtn" onClick="history.go(-1)">
		<div class="text-news">Thể thao</div>
	</div>
	<div id="center">
	</div>
</body>
</html>
